// SharedArrayBuffer polyfill for WeChat Mini Program compatibility
// 微信小程序兼容性处理

// 使用条件编译来处理不同环境
// #ifndef MP-WEIXIN
// 在非小程序环境中禁用 SharedArrayBuffer 相关功能
if (typeof window !== 'undefined') {
  // 在浏览器环境中禁用 SharedArrayBuffer
  if (typeof window.SharedArrayBuffer !== 'undefined') {
    console.warn('[Polyfill] SharedArrayBuffer disabled for WeChat Mini Program compatibility');
    window.SharedArrayBuffer = undefined;
  }
  
  // 禁用 Atomics
  if (typeof window.Atomics !== 'undefined') {
    console.warn('[Polyfill] Atomics disabled for WeChat Mini Program compatibility');
    window.Atomics = undefined;
  }
}

// 在小程序环境中也进行相同处理
if (typeof global !== 'undefined') {
  if (typeof global.SharedArrayBuffer !== 'undefined') {
    console.warn('[Polyfill] SharedArrayBuffer disabled for WeChat Mini Program compatibility');
    global.SharedArrayBuffer = undefined;
  }
  
  if (typeof global.Atomics !== 'undefined') {
    console.warn('[Polyfill] Atomics disabled for WeChat Mini Program compatibility');
    global.Atomics = undefined;
  }
}
// #endif

// 导出空对象，确保模块可以被正常导入
export default {};